package cn.cycleif.enums;

import lombok.Getter;

import java.util.Objects;

@Getter
public enum FileManageEnum {

  LOCAL("0", "本地", "localStrategyImpl"),
  MINIO("1", "minio", "minioStrategyImpl");

  private final String code;
  private final String desc;

  private final String strategy;

  public static FileManageEnum getByStrategyByCode(String code) {
    for (FileManageEnum mode : FileManageEnum.values()) {
      if (Objects.equals(mode.getCode(), code)) {
        return mode;
      }
    }
    return null;
  }

  FileManageEnum(String code, String desc, String strategy) {
    this.code     = code;
    this.desc     = desc;
    this.strategy = strategy;
  }
}
